Skip to content

H2 handle :protocol for extended CONNECT#613

Open
arturobernalg wants to merge 1 commit intoapache:masterfrom
arturobernalg:HTTPCLIENT-973-websocket
Open

H2 handle :protocol for extended CONNECT#613
arturobernalg wants to merge 1 commit intoapache:masterfrom
arturobernalg:HTTPCLIENT-973-websocket

Conversation

@arturobernalg
Copy link
Member

Improve server handling and add extensive core tests/examples Align client usage with core WebSocket APIs
Extend HTTP/2 request conversion and tests

@ok2c DefaultH2RequestConverter has a minimal RFC 8441 change (handling :protocol for CONNECT). This is required for H2 WebSocket server support. I tried to keep it separated, but was impossible.

@arturobernalg arturobernalg requested a review from ok2c February 5, 2026 17:52
@arturobernalg
Copy link
Member Author

A follow‑up PR will expose the client‑side pieces (see https://github.com/apache/httpcomponents-client/pull/762/changes).

@ok2c
Copy link
Member

ok2c commented Feb 7, 2026

@arturobernalg What is your plan? Do you want to provide the server side functionality out of the core project and the client side out of the client project? Should not the client protocol handler also go into core?

@arturobernalg
Copy link
Member Author

@arturobernalg What is your plan? Do you want to provide the server side functionality out of the core project and the client side out of the client project? Should not the client protocol handler also go into core?

@ok2c Plan is to keep server‑side WebSocket over H2 in core and client‑side in httpclient5. The client protocol handler is tied to the client execution stack and config, so it should stay in httpclient5. See apache/httpcomponents-client#762

@ok2c
Copy link
Member

ok2c commented Feb 7, 2026

@arturobernalg Interesting. How are you going to do integrations tests for the websocket protocol when it resides in two separate projects? The separation between core and client for HTTP protocol handlers is reasonably manageable: the message transport and the core protocol handling reside in core, advanced client functions reside in client. The core has integration tests that ensure correctness of the protocol handlers on both ends. in your case, I suspect the split into the server project and the client project will be hurting you in the long run. I do not know. This is your decision to make, but you may be better off having the server side websockets in the client project, at least for a few minor releases.

@arturobernalg arturobernalg force-pushed the HTTPCLIENT-973-websocket branch 2 times, most recently from cf92065 to 2addf93 Compare February 8, 2026 11:12
@arturobernalg
Copy link
Member Author

@arturobernalg Interesting. How are you going to do integrations tests for the websocket protocol when it resides in two separate projects? The separation between core and client for HTTP protocol handlers is reasonably manageable: the message transport and the core protocol handling reside in core, advanced client functions reside in client. The core has integration tests that ensure correctness of the protocol handlers on both ends. in your case, I suspect the split into the server project and the client project will be hurting you in the long run. I do not know. This is your decision to make, but you may be better off having the server side websockets in the client project, at least for a few minor releases.

@ok2c
moved the server‑side WebSocket classes and tests into httpclient5‑websocket as you suggested

@ok2c
Copy link
Member

ok2c commented Feb 8, 2026

@arturobernalg Wait. Again. Do you really want some WS primitives in a different project, so that every time you want something changed in those primitives you need a new release of core? Does that make sense?

Move everything WS related to client. Start low and simple. For your own sake reduce the public API footprint as much as possible. Gradually open it up as it matures, and at some point consider moving core protocol to core.

@arturobernalg arturobernalg force-pushed the HTTPCLIENT-973-websocket branch 2 times, most recently from 1936cc2 to efdf6df Compare February 8, 2026 12:46
@arturobernalg
Copy link
Member Author

@arturobernalg Wait. Again. Do you really want some WS primitives in a different project, so that every time you want something changed in those primitives you need a new release of core? Does that make sense?

Move everything WS related to client. Start low and simple. For your own sake reduce the public API footprint as much as possible. Gradually open it up as it matures, and at some point consider moving core protocol to core.

@ok2c Okay. I'll do it gradually once the whole code is mature enough. I just move something related to WS

@ok2c
Copy link
Member

ok2c commented Feb 8, 2026

@arturobernalg Please update the commit message and the PR title.

Validate extended CONNECT requirements and emit :protocol in HTTP/2 requests.
@arturobernalg arturobernalg force-pushed the HTTPCLIENT-973-websocket branch from efdf6df to fa737d7 Compare February 8, 2026 18:07
@arturobernalg arturobernalg changed the title Add WebSocket support to httpcore5-websocket httpcore5-h2: handle :protocol for extended CONNECT Feb 8, 2026
@arturobernalg arturobernalg changed the title httpcore5-h2: handle :protocol for extended CONNECT H2 handle :protocol for extended CONNECT Feb 8, 2026
@arturobernalg arturobernalg requested a review from ok2c February 8, 2026 18:07
@arturobernalg
Copy link
Member Author

arturobernalg commented Feb 8, 2026 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants